package com.huijun.product.controller;

import com.huijun.common.utils.R;
import com.huijun.product.entity.CategoryEntity;
import com.huijun.product.service.CategoryService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("product/category1")
public class Category1Controller {

    @Autowired
    private CategoryService categoryService;

    @RequestMapping("getTree")
    public R getTree() {
        List<CategoryEntity> list = categoryService.getTree();
        return R.ok().put("data",list);
    }
 }
